import GameView from "../../../quick/core/ui/GameView";
import { inject } from "../../../quick/defines/Decorators";
import { Macro } from "../../../quick/defines/Macros";
import LoginLogic from "../logic/LoginLogic";

const { ccclass, property } = cc._decorator;

@ccclass
export default class LoginView extends GameView {

    static logicType = LoginLogic;
    static getPrefabUrl(){
        return `@LoginView`;
    }

    @inject({ type : LoginLogic , name : "logic"})
    private logic : LoginLogic = null!;

    @inject("login",cc.Node)
    private login: cc.Node = null!;
    @inject("version",cc.Label)
    private version : cc.Label = null!;

    onLoad() {
        super.onLoad();
        this.version.string = App.updateManager.getVersion(this.bundle);
        this.onN(this.login,cc.Node.EventType.TOUCH_END,this.onLogin);
    }

    private onLogin(){
        this.logic.onLogin();
    }
}
